{extend name="default/template/base_index" /}


{block name="area_header"}
<link src="__CDN__/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css" rel="stylesheet" type="text/css" />

<link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/select2.min.css" />
<link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/cosmo-skin.css" />
{/block}

{block name="area_body"}
{include file="default/Widget/topbar" /}
<div class="admin-main container-fluid">
	{include file="default/Widget/left" /}
	<div class="admin-main-content">
		{include file="default/Widget/breadcrumb" /}
		<!-- form -->
		<form class="form-horizontal well validateForm">
			<fieldset>
				<legend>
					{present name="parentMenu"}
					{$parentMenu.title}-{:L('VIEW_SUBMENU')}
					{else/}{:L('MENU')}{/present}-{:L('BTN_ADD')}</legend>
				<div class="form-group">
					<label for="inputtitle" class="col-md-2 col-lg-2 control-label">{:L('TITLE')}</label>
					<div class="col-md-10 col-lg-10">
						<input type="text" class="required form-control input-short" name="title" id="inputtitle" placeholder="{:L('PLACEHOLDER_TITLE')}">
					</div>
				</div>
				<div class="form-group">
					<label for="inputtitle" class="col-md-2 col-lg-2 control-label">{:L('VIEW_URL')}</label>
					<div class="col-md-10 col-lg-10">
						<input type="text" class="required form-control input-normal" name="url" id="inputtitle" placeholder="{:L('PLACEHOLDER_URL')}">
					</div>
				</div>
				<div class="form-group">
					<label for="inputpid" class="col-md-2 col-lg-2 control-label">所属上级菜单</label>
					<div class="col-md-10 col-lg-10">
						<select name="pid" class="form-control input-normal select2">
							<option value="0">顶级菜单</option>
							{volist name="menus" id="vo"}
							<option {eq name="pid" value="$vo.id"}selected="selected"{/eq} value="{$vo.id}">{$vo.title_show}</option>
							{/volist}
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="inputfront" class="col-md-2 col-lg-2 control-label">{:L('IS_FRONT')}</label>
					<div class="col-md-10 col-lg-10 input-number">
						<div class="checkbox">
							<label>
								<input type="checkbox" class=" " id="inputfront" name="is_front" value="1">
							</label>
						</div>

					</div>
				</div>
				<div class="form-group">
					<label for="inputhide" class="col-md-2 col-lg-2 control-label">{:L('VIEW_ISHIDE')}</label>
					<div class="col-md-10 col-lg-10 input-number">
						<div class="checkbox">
							<label>
								<input type="checkbox" class="
							 " id="inputhide" name="hide" value="1">
							</label>
						</div>

					</div>
				</div>
				<div class="form-group">
					<label for="inputis_dev" class="col-md-2 col-lg-2 control-label">{:L('VIEW_ISDEV')}</label>
					<div class="col-md-10 col-lg-10 input-number">
						<div class="checkbox">
							<label>
								<input type="checkbox" class="
							 " id="inputis_dev" name="is_dev" value="0">
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="inputtip" class="col-md-2 col-lg-2 control-label">{:L('VIEW_TIP')}</label>
					<div class="col-md-10 col-lg-10 ">
						<textarea class="form-control input-normal" rows="3" name="tip"></textarea>

					</div>
				</div>
				<div class="form-group">
					<label for="inputsort" class="col-md-2 col-lg-2 control-label">{:L('SORT')}</label>
					<div class="col-md-10 col-lg-10 input-number">
						<input type="text" class="required form-control
							 input-number" id="inputsort" name="sort" value="0">
					</div>
				</div>
				<div class="form-group">
					<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
					<div class="col-lg-10 col-md-10">
						<a target-form="validateForm" class="ajax-post btn btn-primary" href="{:url('Menu/add',array('pid'=>request()->param('pid',0)))}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
						<a class="btn btn-default" href="{:url('Menu/index',array('pid'=>request()->param('pid',0)))}"><i class="fa fa-times-circle"></i> {:L('BTN_CANCEL')}</a>
					</div>
				</div>
			</fieldset>
		</form>
		<!-- form -->
	</div>

</div>
{/block}

{block name="area_footer"}

<script src="__CDN__/jquery-validation/1.13.1/jquery.validate.min.js"></script>
<script src="__CDN__/jquery-validation/1.13.1/localization/messages_zh.min.js"></script>
<script src="__CDN__/select2/4.0.0/js/select2.min.js"></script>
<script src="__CDN__/select2/4.0.0/js/i18n/zh-CN.js"></script>
<script src="__CDN__/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js"></script>
<script>
    $(function() {
        $("#inputsort").TouchSpin({
            initval: 0
        });
        $(".validateForm").validate();
        $(".select2").select2({
            language:"zh-CN"
        });
    });
</script>
{/block}